// Harris_corner_detection.cpp : 定义控制台应用程序的入口点。
#include "stdafx.h" 
#include "Harris_corner_detection.h"
//bool Compare_Cr(vector<Point2f> corners1, vector<Point2f> corners2);

int main()
{
    //以灰度模式载入图像并显示
	Mat srcImage1 = imread("TL01.png", 0);
	Mat srcImage2 = imread("TL02.png", 0);
	Mat srcImage3 = imread("TL03.png", 0);
	Mat srcImage4 = imread("TL04.png", 0);
	Mat srcImage5 = imread("TL05.png", 0);
	Mat srcImage6 = imread("TL06.png", 0);
	Mat srcImage01 = imread("T01.png", 0);
	Mat srcImage02= imread("T02.png", 0);
	Mat srcImage03= imread("T03.png", 0);
	Mat srcImage04= imread("T04.png", 0);

	//Mat copy = srcImage1.clone();
	//Mat cornerStrength;
	vector<Point2f> corners1 = GetCorners(srcImage1);
	vector<Point2f> corners2 = GetCorners(srcImage2);
	vector<Point2f> corners3 = GetCorners(srcImage3);
	vector<Point2f> corners4 = GetCorners(srcImage4);
	vector<Point2f> corners5 = GetCorners(srcImage5);
	vector<Point2f> corners6 = GetCorners(srcImage6);
	vector<Point2f> corners01 = GetCorners(srcImage01);
	vector<Point2f> corners02= GetCorners(srcImage02);
	vector<Point2f> corners03= GetCorners(srcImage03);
	vector<Point2f> corners04 = GetCorners(srcImage04);

	CompareCr(corners01,corners1);
//	CompareCr(GetCorners(srcImage1), GetCorners(srcImage2));
//		printf("%f", d);
	//cvWaitKey(100000);
//	waitKey(1000000);
	return 0;
}

/*//进行Harris角点检测找出角点
cornerHarris(srcImage, cornerStrength, 2, 3, 0.01);
//对灰度图进行阈值操作，得到二值图并显示
Mat harrisCorner;
threshold(cornerStrength, harrisCorner, 0.00001, 255, THRESH_BINARY);
imshow("2", harrisCorner);
*/

//for (int i=0;i<corners.size(); i++)